package com.group3.controller.studentController;

import com.group3.utils.Result;
import com.group3.pojo.UpdatePassword;
import com.group3.service.StudentService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;

/**
 * StudentController
 *
 * @author HY
 * 2021/06/05 9:41
 **/

@Api(tags = "学生接口")
@RestController
@RequestMapping("/student")
@CrossOrigin
public class StudentController {
    @Resource
    private StudentService studentService;

    @PutMapping(value = "/password",consumes = "application/json")
    @ApiOperation(value = "修改密码")
    public Result putPassword(@RequestBody UpdatePassword updatePassword, HttpServletRequest request){

        String token = request.getHeader("token");//获取token
        Result result = studentService.putPassword(updatePassword,token);

        return result;
    };

}
